answer "Are you sure you want to do this?" with Ok or Cancel
if it is "Ok" then
set userlevel to 5
set lockscreen to true
set lockmessages to true
set lockrecent to true
push card
go home
put the long name of this stack into deststack
delete char 1 to 7 of deststack
delete last char of deststack
pop card
put the long name of this stack into srcstack
delete char 1 to 7 of srcstack
delete last char of srcstack
rescopy srcstack,deststack,"XCMD",300
rescopy srcstack,deststack,"DLOG",2238
rescopy srcstack,deststack,"DLOG",11305
rescopy srcstack,deststack,"DLOG",1331
rescopy srcstack,deststack,"DITL",3265
rescopy srcstack,deststack,"DITL",16969
rescopy srcstack,deststack,"DITL",30874
rescopy srcstack,deststack,"DITL",27339
rescopy srcstack,deststack,"ALRT",30844
rescopy srcstack,deststack,"WIND",27988
set lockscreen to false
set lockrecent to false
set lockmessages to false
answer "Hyperedit is installed in Home." with Ok
answer "Please quit and relaunch HyperCard to use it." with OK
end if
end mouseup
-- part contents for card part 1
----- text -----
Hyperedit is a FREE XCMD HyperCard script editor; if you are going to give it to someone else, give it to them with this stack. Hyperedit may not be sold, nor may it be included on public domain disks that are being sold.
Hyperedit has reached its first stable state, and I have been using it consistently now for a while. HOWEVER, AS WITH ALL PUBLIC DOMAIN PROGRAMS, YOU SHOULD BE VERY CAREFUL USING THIS. There is one bad bug that I know of. If you try to edit the script of an object that does not exist, you will get a system error. The way you could do this is by typing 'hyperedit blah' into the msg window where blah does not exist. So far, I have found no way to verify if an object actually exists from within an XCMD. Because of this problem and the probability of typos, I do not recommend trying to pass an argument to Hyperedit from the msg window for now.
To run Hyperedit, you have a number of options:
1) You can type hyperedit in the msg window.
2) Put the following script along with hyperedit in your home stack:
on mousewithin
global hyperedittemp
set lockmessages to true
set lockrecent to true
if (the commandkey is down) and (the shiftkey is down) then
hyperedit the target
end if
set lockrecent to false
set lockmessages to false
end mousewithin
Whenever you are within a button or field and hold down the command and shift keys, you will run hyperedit with the appropriate script loaded. Try doing this on this stack which has this handler in it.
3) You could also use this handler:
on controlkey thekey
global hyperedittemp
if thekey = 5 then
hyperedit the name of this stack
end if
end controlkey
When you hit Control-e, you will run hyperedit. Try it.
4) Finally, you could use this handler:
on returnkey
global hyperedittemp
if the shiftkey is down and the optionkey is down then
hyperedit the name of this card
else if the optionkey is down then
hyperedit the name of this background
else if the shiftkey is down then
hyperedit the name of this stack
else
pass returnkey
end if
end returnkey
When you run Hyperedit, you get an additional menu in your menubar. From this menu, you can do the following:
Edit a new script -- This gives you a list of scripts available. You can also get it by holding down the command and shift keys and holding down the mouse button.
Save your current script
Print your current script
Execute the commands in the current selection range
Comment out the current selection range
Uncomment the current selection range
Find text
Find the next occurence of something you found
Change text (including a replace all)
Leave Hyperedit
Get a wimpy about box
You also have access to a number of the standard HyperCard menus. For instance, you can access desk accessories while in Hyperedit. The following are the menu items you should be able to access:
Desk accessories
MultiFinder entries
New Stack
Open Stack
Save a Copy
Compact Stack
Quit HyperCard
Cut
Copy
Paste
New Card
Background
Back
Home
Help
Recent
First
Prev
Next
Last
Button Info (Sometimes)
Field Info (Sometimes)
Card Info
Bkgnd Info
Stack Info
New Button
New Field
New Background
Currently, I don't do undos, and I also allow only one window open at a time. I hope to have future releases implement these (no promises however). If you want to always be able to run hyperedit, you can install it by clicking on the Install in Home button, but it's up to you to put whichever scripts you want in your home stack to activate Hyperedit. Also, for Hyperedit to be recognized as a command, you will have to quit HyperCard after installing it in your home stack. As with all new programs, be careful using this, and look for new releases fixing bugs. Enjoy.